package com.jye.cloud.user.mapper;

import com.jye.cloud.domain.Classes;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


@Mapper
public interface ClassMapper {

    Classes findClassById(@Param("id") int id);

    List<Classes> findAllClass(@Param("skip")int skip,@Param("limit")int limit);

    List<Integer> findMyClassIdByUserId(@Param("uId") int uId,@Param("skip")int skip,@Param("limit")int limit);

    void addClass(@Param("classes")Classes classes);

    void updateClass(@Param("classes")Classes classes);

    void addUserToClass(@Param("uId")int uId, @Param("cId")int cId);

    List<Classes> findClassesByCId(@Param("cId") int cId);

    List<Integer> findUsersIdsByCId(@Param("cId") int cId);

    List<Classes> findClassByCId(@Param("cId")int cId);

    int isInClass(@Param("uId")int uId, @Param("id")int id);

    int findClassIdByUId(@Param("uId")int uId);

    String findClassNameById(@Param("id")int id);

    List<Integer> findClassIdsByCId(@Param("cId")int cId);

    List<Integer> findUsersIdsById(@Param("id")int id);


    Classes findClassByShareCode(@Param("shareCode")String shareCode);

    List<Classes> findClassByName(@Param("name")String name);

    void deleteClassById(@Param("id") int id);

    void deleteUserToClassByUIdAndCId(@Param("uId")int uId,@Param("cId") int cId);
}
